package com.linkdood.app;

import com.linkdood.app.component.WebSocketServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * 项目启动类
 * @author YunJ
 */
@SpringBootApplication
@EnableAsync
@EnableCaching
public class AppApplication {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(AppApplication.class);
        ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args);
        // FIXME: 4/16/21 (syj) 解决WebSocket不能注入的问题, 但因为这里是手动注入，所以单元测试环境加载不了
        WebSocketServer.setApplicationContext(configurableApplicationContext);
    }

}
